<template>
  <div id="app">
   <div class="pre" @click="pre">Pre 当前：{{page}}</div>
    <router-view :page="page"/>
    <div class="next"  @click="next">next </div>
  </div>
</template>

<script>
export default {
  name: 'App',
  data(){
    return {
      page:1
    }
  },

  methods:{
  pre(){
    if(this.page>1){
    this.page--;
  }
    else{
      alert('到头了')
    }
  },
  next(){
    this.page++;
  }
}
}

</script>

<style>
*{  margin: 0;padding: 0}
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
.pre,.next{
  cursor: pointer;
  width: 100%;
  height:80px;
  line-height:80px;
  background: rgba(7,17,27,.1)
}
</style>
